package c.j.a.d.b.j;

import android.content.Context;
import android.net.ConnectivityManager;
import android.net.ConnectivityManager.NetworkCallback;
import android.net.Network;
import android.net.NetworkRequest.Builder;

/* compiled from: RetryScheduler */
public class x implements Runnable {
    public final /* synthetic */ a0 a;

    /* compiled from: RetryScheduler */
    public class a extends NetworkCallback {
        public void onAvailable(Network network) {
            c.j.a.d.b.g.a.d("RetryScheduler", "network onAvailable: ");
            x.this.a.b(1, true);
        }
    }

    public x(a0 a0Var) {
        this.a = a0Var;
    }

    public void run() {
        try {
            a0 a0Var = this.a;
            Context context = a0Var.a;
            if (context != null) {
                a0Var.g = (ConnectivityManager) context.getApplicationContext().getSystemService("connectivity");
                this.a.g.registerNetworkCallback(new Builder().build(), new a());
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
